#{extends 'mainContent.html' /}
#{set title:'Products'/}

<h1 class="title">Products</h1>

<ul class="productList">
	#{list items:productTypes,as:'productType'}
		<li>
		<h2>${productType.name}</h2>
		<a href="@{listProducts(productType.id)}"><img src="${play.configuration['attachments.download.prefix']+productType.image}" width="250" height="180" border="0"></img></a>
		<ul>
			#{list items:productType.children,as:'subType'}
				<li><a href="@{listProducts(subType.id)}">${subType.name}</a></li>
			#{/list}
			#{list items:productType.products,as:'prod'}
				<li><a href="@{overview(prod.id)}">${prod.name}</a></li>
			#{/list}
		</ul>
		</li>
	#{/list}

</ul>